//string1.h -- fixed and augmented string class definition
#ifndef CHAPTER11_STRING1_H_
#define CHAPTER11_STRING1_H_

#include <iostream>
using std::ostream;
using std::istream;

class String_12_4
{
private:
	char * str;			//pointer to string
	int len;			//length of string
	static int num_strings;	//number of objects
	static const int CINLIM = 80;	//cin input limit
public:
//constructors and other metheds
	String_12_4(const char * s);		//constructor
	String_12_4();						//default constuctor
	String_12_4(const String_12_4 &);	//copy constructor
	~String_12_4();						//destructor
	int length() const { return len; };
//overloaded operator methods
	String_12_4 & operator=(const String_12_4 &);
	String_12_4 & operator=(const char *);
	char & operator[](int i);
	const char & operator[] (int i) const;
//overloaded operator friends
	friend bool operator<(const String_12_4 &st, const String_12_4 &st2);
	friend bool operator>(const String_12_4 &st1, const String_12_4 &st2);
	friend bool operator==(const String_12_4 &st, const String_12_4 &st2);
	friend ostream & operator<<(ostream & os, const String_12_4 & st);
	friend istream & operator>>(istream & is, String_12_4 & st);
//static function
	static int HowMany();
};
#endif
